﻿<Window x:Class="ExceptionDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Error" SizeToContent="WidthAndHeight" MinHeight="100" MinWidth="200" ResizeMode="NoResize">
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition  Height="*"/>
                <RowDefinition  Height="Auto"/>
                <RowDefinition  Height="Auto"/>
            </Grid.RowDefinitions>


            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"  />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <!--<TextBlock Margin="6" VerticalAlignment="Center">Error</TextBlock> -->
                <TextBlock MinWidth="300" MaxWidth="400" Grid.Column="1" Margin="10" TextWrapping="Wrap" Text="{Binding Path=Message}"/>
            </Grid>

            <Rectangle RadiusX="5" RadiusY="5"  Fill="AliceBlue" Grid.Row="1" Stroke="LightGray"></Rectangle>
            
            <Expander Grid.Row="1" IsExpanded="False">
                
                <Expander.Header>
                    <TextBlock ToolTip="Expand this area to view additional diagnostic information." >Details</TextBlock>
                </Expander.Header>
                
                <Grid MaxWidth="400">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    
                    <TextBlock Text="Source" Margin="4" VerticalAlignment="Center" />
                    <TextBox IsReadOnly="True" Grid.Column="1"  Margin="4" Text="{Binding Path=Source,Mode=OneWay}" />
                    
                    <TextBlock Grid.Row="1" Text="Stack Trace" Margin="4" VerticalAlignment="Top" />
                    
                    <TextBox 
                        IsReadOnly="True"
                        Margin="4"
                        Grid.Column="1"
                        Grid.Row="1"
                        TextWrapping="NoWrap" 
                        VerticalScrollBarVisibility="Visible" 
                        HorizontalScrollBarVisibility="Auto" 
                        AcceptsTab="True" 
                        HorizontalAlignment="Stretch"
                        AcceptsReturn="True" 
                        ToolTip="{Binding Path=StackTrace,Mode=OneWay}"
                        Text="{Binding Path=StackTrace,Mode=OneWay}" 
                        MinHeight="100">
                        
                    </TextBox>
                </Grid>
            </Expander>
            
            <Grid Grid.Row="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                
                <TextBlock VerticalAlignment="Center" Margin="4"><Hyperlink ToolTip="Copies the details of the error to the clipboard" Click="CopyToClipboardHyperlink_Click">Copy to clipboard</Hyperlink></TextBlock>
                
                <Button Grid.Column="2" MinHeight="23" Margin="4" Name="OKButton" VerticalAlignment="Bottom" Width="75" IsCancel="True" IsDefault="True">_OK</Button>
            </Grid>
            
            

        </Grid>
       
    
    </Grid>
</Window>
